//
//  CMCCIOTTipsCenter.m
//  ig
//
//  Created by s on 16/5/25.
//  Copyright © 2016年 CMCCIOT. All rights reserved.
//

#import "CMCCIOTTipsCenter.h"
#import "TipsCenter.h"

@implementation CMCCIOTTipsCenter
+(void)showErrorWithStatus:(NSString  *_Nonnull)strTips{
        
    [[TipsCenter  center]  addTip:strTips level:ZDTipsLevelNotice  offset:44];
}
+(void)showSuccessWithStatus:(NSString  *_Nonnull)strTips{

   [[TipsCenter  center]  addTip:strTips level:ZDTipsLevelSuccess  offset:44];

}
+(CMCCIOTIGAlertControlCustomer *)showAlertTitle:(NSString * _Nonnull)title message:(NSString * _Nonnull)message cancelTitle:(NSString * _Nonnull)cancelTitle cancelBlock:(alertActionBlock)cancelBlock quireTitle:(NSString * _Nonnull)quireTitle quireBlock:(alertActionBlock)quieBlock{
    
    CMCCIOTIGAlertControlCustomer  *alert = [CMCCIOTIGAlertControlCustomer alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerCustomStyleAlert];
    
    cancelBlock?[alert addAction:[CMCCIOTIGAlertActionCustomer  actionCustomerWithTitle:cancelTitle style:UIAlertActionCustomeStyleDarkGray  handler:cancelBlock]]:nil;
    
    quieBlock?[alert addAction:[CMCCIOTIGAlertActionCustomer actionCustomerWithTitle:quireTitle style:UIAlertActionCustomeStyleBlack handler:quieBlock]]:nil;
    
    [[CMCCIOTIGSharePopWindow  sharedWindow ]   showWithSubView:alert];
    return alert;
}

+(void)showAlertAddressTitle:(NSString * _Nonnull)title message:(NSString * _Nonnull)message arrAction:(NSArray  *_Nonnull)arrEnvironment{

    CMCCIOTIGAlertControlCustomer  *alert = [CMCCIOTIGAlertControlCustomer alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerCustomStyleVerticalStyle];
    [arrEnvironment enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [alert addAction:obj];
        
    }];

    [[CMCCIOTIGSharePopWindow  sharedWindow ]   showWithSubView:alert];


}

+(CMCCIOTIGAlertControlCustomer  *)showAlertAddressTitle:(NSString * _Nonnull)title message:(NSString * _Nonnull)message andTFOne:(textFieldBLock )textFieldBlockOne arrAction:(NSArray  *_Nonnull)arrEnvironment{
    
    CMCCIOTIGAlertControlCustomer  *alert = [CMCCIOTIGAlertControlCustomer alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerCustomStyleVerticalStyle];
    [arrEnvironment enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
        [alert addAction:obj];
        
    }];
    
    textFieldBlockOne?[alert addTextFieldWithConfigurationHandler:textFieldBlockOne]:nil;
    
    [[CMCCIOTIGSharePopWindow  sharedWindow ]   showWithSubView:alert];
    
    return   alert;
}



+(CMCCIOTIGAlertControlCustomer  *)showAlertTextFieldTitle:(NSString * _Nonnull)title message:(NSString * _Nonnull)message andTFOne:(textFieldBLock )textFieldBlockOne  andTFTwo:(textFieldBLock )textFieldBlockTwo  cancelTitle:(NSString * _Nonnull)cancelTitle cancelBlock:(alertActionBlock)cancelBlock quireTitle:(NSString * _Nonnull)quireTitle quireBlock:(alertActionBlock)quieBlock{
    
    CMCCIOTIGAlertControlCustomer  *alert = [CMCCIOTIGAlertControlCustomer alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerCustomStyleAlert];
    textFieldBlockOne?[alert addTextFieldWithConfigurationHandler:textFieldBlockOne]:nil;
     textFieldBlockTwo?[alert addTextFieldWithConfigurationHandler:textFieldBlockTwo]:nil;
    
    [alert addAction:[CMCCIOTIGAlertActionCustomer actionCustomerWithTitle:cancelTitle style:UIAlertActionCustomeStyleCancel  handler:cancelBlock]];
    
    [alert addAction:[CMCCIOTIGAlertActionCustomer actionCustomerWithTitle:quireTitle style:UIAlertActionCustomeStyleDefault handler:quieBlock]];
    
    [[CMCCIOTIGSharePopWindow  sharedWindow ]   showWithSubView:alert];
    
    return alert;
    
}



+(CMCCIOTIGAlertControlCustomer  *)showAlertTextFieldTitle:(NSString * _Nonnull)title message:(NSString * _Nonnull)message andTF:(NSArray  *)arrTextField  cancelTitle:(NSString * _Nonnull)cancelTitle cancelBlock:(alertActionBlock)cancelBlock quireTitle:(NSString * _Nonnull)quireTitle quireBlock:(alertActionBlock)quieBlock{

    CMCCIOTIGAlertControlCustomer  *alert = [CMCCIOTIGAlertControlCustomer alertControllerWithTitle:title message:message preferredStyle:UIAlertControllerCustomStyleAlert];
    
    
    [arrTextField  enumerateObjectsUsingBlock:^(id  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
       
        [alert addTextFieldWithConfigurationHandler:obj]
        ;
    }];

    
    [alert addAction:[CMCCIOTIGAlertActionCustomer actionCustomerWithTitle:cancelTitle style:UIAlertActionCustomeStyleCancel  handler:cancelBlock]];
    
    [alert addAction:[CMCCIOTIGAlertActionCustomer actionCustomerWithTitle:quireTitle style:UIAlertActionCustomeStyleDefault handler:quieBlock]];
    
    [[CMCCIOTIGSharePopWindow  sharedWindow ]   showWithSubView:alert];
    
    return alert;


}



@end
